import org.gruposp2p.aularest.model.Absence;
import org.gruposp2p.aularest.model.Student;
import org.gruposp2p.aularest.model.Subject;
import org.gruposp2p.aularest.service.AulaDataService;
import org.gruposp2p.aularest.service.AulaDataServiceImpl;
import org.gruposp2p.aularest.utils.DateUtils;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jj
 */
public class InsertAbsence {

    public static void main (String[] args) throws Exception {
        AulaDataService dataService = new AulaDataServiceImpl();
        Absence absence = new Absence();
        absence.setDate(DateUtils.getTodayDate());
        absence.setDescription("Description 001");
        absence.setJustified(Boolean.TRUE);
        Student student =
                dataService.findStudent(new Integer(201));
        absence.setStudentId(student);
        Subject subject = dataService.findSubject(new Integer(1));
        absence.setSubjectId(subject);
        dataService.createAbsence(absence);
    }

}
